<%@page import="edu.tgc.security.SessionUserUtils"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。
	pageContext.setAttribute("basePath",basePath);
%>
	
 <script type="text/javascript">
 var now=new Date();
 $(function(){
	var nowStr="";
	nowStr=now.getFullYear()+"-";
	nowStr+=(now.getMonth()+1)+"-";
	nowStr+=now.getDate()+" ";
	nowStr+=now.getHours()+":";
	nowStr+=now.getMinutes()+":";
	nowStr+=now.getSeconds();
	$('#createTimeInp').val(nowStr);
});
</script>
 
<form action="${param.action}" method="post" id="teaching_particpant_form">
	<input type="hidden" name="id" value="${model.id}">
	<input type="hidden" name="creator.id" value="<%=SessionUserUtils.getSysUser().getId().toString()%>">
	<input id="createTimeInp" type="hidden" name="createTime" value="">
	
	<div class="custom-form">
		<ul>
			<li><span>报名项目</span><input name="enroll.id" class="easyui-combogrid" data-options="required:true,value : '${model.enroll.id}',	
			width : 148,
			panelWidth : 650,
			idField : 'id',
			textField : 'name',
			url : 'teaching/enroll/page?sort=endTime&endTimeBool=true',
			pagination : true,
			pageSize : 5,
			pageList : [5,10, 20, 50 ],
			search : {
				position : 'bottom'
			}, 
        	onShowPanel:function(){
        		$(this).combogrid('grid').datagrid('search.init');
        	},
			columns : [ [{
				field:'id',
				title:'id',
				hidden: true,
				width:150			
			} , {
				field:'name',
				title:'名称',
				width:150
						
			} , {
				field:'dept',
				title:'报名范围',
				width:150,
				formatter:function(value,row){return value==undefined?'':value.name;} 
						
			} , {
				field:'comment',
				title:'说明',
				width:250 			
			}, {
				field:'creator',
				title:'发布人',
				width:80,
				formatter:function(value,row){return value==undefined?'':value.name;}		
			} ] ],icons:[clearInput_icon]"></li>
			<li><span>姓名：</span><input name="student.id" type="text"  class="easyui-combogrid" data-options="
			required:true,
			value : '${model.student.id}',	
			width : 148,
			panelWidth : 650,
			idField : 'id',
			textField : 'name',
			url : 'student/student/page?sort=stuNo&isUsed=true',
			pagination : true,
			pageSize : 5,
			pageList : [5,10, 20, 50 ],
			search : {
				position : 'bottom'
			}, 
        	onShowPanel:function(){
        		$(this).combogrid('grid').datagrid('search.init');
        	},
			columns : [ [{
				field:'id',
				title:'id',
				hidden: true,
				width:150			
			} , {
				field:'idNo',
				title:'身份证号',
				width:150
						
			} , {
				field:'name',
				title:'姓名',
				width:150 
						
			} , {
				field:'banji',
				title:'班级',
				width:150 ,
				formatter:function(value,row){return value==undefined?'':value.name;}			
			}, {
				field:'sex',
				title:'性别',
				width:40		
			} , {
				field:'nation',
				title:'民族',
				width:60		
			}  , {
				field:'manager',
				title:'班主任',
				width:100 ,
				formatter:function(value,row){return row.banji.manager==undefined?'':row.banji.manager.name;}			
			} ] ],icons:[clearInput_icon]
 			" /></li>
			<li><span>报名费：</span><input name="cost" value="${model.cost}" class="easyui-numberbox" 	data-options="precision:2" /></li>
			
			<li style="width:450px;"><span>说明：</span><textarea name="comment" class="easyui-textbox" data-options="multiline:true" style="float: left; width: 350px; height: 100px">${model.comment}</textarea></li>
		</ul>
	</div>
</form>
